//侧滑栏
var menuButton = document.querySelector('.menu-button');
    var openMenu = function () {
      swiper.slidePrev();
    };
    var swiper = new Swiper('.swiper-container', {
      slidesPerView: 'auto',
      initialSlide: 1,
      resistanceRatio: 0,
      slideToClickedSlide: true,
      on: {
        slideChangeTransitionStart: function () {
          var slider = this;
          if (slider.activeIndex === 0) {
            menuButton.classList.add('cross');
            // required because of slideToClickedSlide
            menuButton.removeEventListener('click', openMenu, true);
          } else {
            menuButton.classList.remove('cross');
          }
        }
        , slideChangeTransitionEnd: function () {
          var slider = this;
          if (slider.activeIndex === 1) {
            menuButton.addEventListener('click', openMenu, true);
          }
        },
      }
    });
 
 //登录代码
function Login(){
		 	var name=document.getElementById("name").value;
		 	var psd=document.getElementById("psd").value;
		 	var qq="qq";
		 	var mm="123";
		 	if(qq==name&&mm==psd){
		 		 alert("登录成功！")
		 		 window.location.href="home.html";
		 		 
		 	}else{
		 		alert("登录失败！")
		 	}
		 }


//泡泡
$(".header").circleMagic({
				//指定那个容器 
				elem:".header",
				//圆形的半径
				radius:35,
				//设置圆的密度 建议不要太大 
				densety:0.5,
				//设置圆形颜色
				color:"rgba(255,255,255,0.5)",
				//color:"random",
				//设置圆形消失数量
				clearOffset:0.3
			});
			

//天气
(function(a,h,g,f,e,d,c,b){b=function(){d=h.createElement(g);c=h.getElementsByTagName(g)[0];d.src=e;d.charset="utf-8";d.async=1;c.parentNode.insertBefore(d,c)};a["SeniverseWeatherWidgetObject"]=f;a[f]||(a[f]=function(){(a[f].q=a[f].q||[]).push(arguments)});a[f].l=+new Date();if(a.attachEvent){a.attachEvent("onload",b)}else{a.addEventListener("load",b,false)}}(window,document,"script","SeniverseWeatherWidget","//cdn.sencdn.com/widget2/static/js/bundle.js?t="+parseInt((new Date().getTime() / 100000000).toString(),10)));
  window.SeniverseWeatherWidget('show', {
    flavor: "bubble",
    location: "WT029G15ETRJ",
    geolocation: false,
    language: "zh-Hans",
    unit: "c",
    theme: "auto",
    token: "a812a976-7126-4a61-a9b1-e95e3872ff1a",
    hover: "enabled",
    container: "tp-weather-widget"
  });
  
//网页时间
$(function(){
				
				 setInterval(function(){
		  	   	   calTime();
		  	   },1000);
				//定义一个有名字的方法函数
				function calTime(){
		  		   var  nowTime = new Date();
		  		   //获取小时
		  		   var hour = nowTime.getHours();
		  		   //获取分钟
		  		   var minutes = nowTime.getMinutes();
		  		   var seconds = nowTime.getSeconds();
		  		   var arr = new Array("星期日","星期一","星期二","星期三","星期四","星期四","星期五","星期六","星期天")[nowTime.getDay()];
					//获取当前显示的节点  找到class名为box的html并进行修改
					 $("#time").html(hour+":"+minutes+":"+seconds+arr);
					 
				}
			})

//网页日期
$(function(){
				
				 setInterval(function(){
		  	   	   calTime();
		  	   },1000);
				//定义一个有名字的方法函数
				function calTime(){
		  		   var  nowTime = new Date();
		  		   var year = nowTime.getFullYear();
		  		   var month = nowTime.getMonth()+1;
		  		   var day = nowTime.getDate();
					//获取当前显示的节点  找到class名为box的html并进行修改
					 $("#date").html(year+"/"+month+"/"+day);
					 
				}
			})



